package org.crackjack.android.model;

import java.io.Serializable;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Country or city for search
 * 
 * 
 * @author Dmitry Kalachov
 * 
 */
public class Location extends Identify implements Serializable, Parcelable {

    private static final long serialVersionUID = -7326996580223403034L;
    private String country;
    private String city;

    public static final Parcelable.Creator<Location> CREATOR = new Parcelable.Creator<Location>() {

        @Override
        public Location createFromParcel(Parcel source) {
            return new Location(source);
        }

        @Override
        public Location[] newArray(int size) {
            return new Location[size];
        }
    };

    private Location(Parcel parcel) {
        id = parcel.readLong();
        country = parcel.readString();
        city = parcel.readString();
    }

    public Location() {

    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(id);
        dest.writeString(country);
        dest.writeString(city);
    }

}
